logo
Expand description

This crate provides the core of the Sentry SDK, which can be used to log events and errors.

sentry-core is meant for integration authors and third-party library authors that want to instrument their code for sentry.

Regular users who wish to integrate sentry into their applications should instead use the sentry crate, which comes with a default transport and a large set of integrations for various third-party libraries.

Core Concepts

This crate follows the Unified API guidelines and is centered around the concepts of Client, Hub and Scope, as well as the extension points via the Integration, Transport and TransportFactory traits.

Minimal API

By default, this crate comes with a so-called “minimal” mode. This mode will provide all the APIs needed to instrument code with sentry, and to write sentry integrations, but it will blackhole a lot of operations.

In minimal mode some types are restricted in functionality. For instance the Client is not available and the Hub does not retain all API functionality.

Features

  • feature = "client": Activates the Client type and certain Hub functionality.
  • feature = "test": Activates the test module, which can be used to write integration tests. It comes with a test transport which can capture all sent events for inspection.
  • feature = "debug-logs": Uses the log crate for debug output, instead of printing to stderr. This feature is deprecated and will be replaced by a dedicated log callback in the future.

Modules

The current latest sentry protocol version.

This provides testing functionality for building tests.

This crate provides common types for working with the Sentry protocol or the Sentry server. It’s used by the Sentry Relay infrastructure as well as the rust Sentry client.

Macros

Returns the intended release for Sentry as an Option<Cow<'static, str>>.

Structs

Represents a single breadcrumb.

The Sentry Client.

Configuration settings for the client.

A Sentry Envelope.

The central object that can manages scopes and clients.

Holds contextual data for the current scope.

A scope guard.

A future that binds a Hub to its execution.

A running Performance Monitoring Span.

An Iterator over HTTP header names and values needed for distributed tracing.

A running Performance Monitoring Transaction.

The Transaction Context used to start a new Performance Monitoring Transaction.

Represents user info.

Enums

Represents the level of severity of an event or breadcrumb.

The Session Mode of the SDK.

A wrapper that groups a Transaction and a Span together.

Traits

Integration abstraction.

A helper trait that converts self into an Iterator of Breadcrumbs.

Helper trait to convert a string into an Option<Dsn>.

Future extensions for Sentry.

The trait for transports.

A factory creating transport instances.

Functions

Records a breadcrumb by calling a function.

Captures a std::error::Error.

Captures an event on the currently active client if any.

Captures an arbitrary message.

Invokes a function that can modify the current scope.

End the current Release Health Session.

End the current Release Health Session with the given SessionStatus.

Create a sentry Event from a std::error::Error.

Returns the last event ID captured.

Parse the types name from Debug output.

Start a new session for Release Health.

Start a new Performance Monitoring Transaction.

Looks up an integration on the current Hub.

Temporarily pushes a scope for a single call optionally reconfiguring it.